<%@ page language="java" pageEncoding="utf-8"%>
<%@taglib prefix="s" uri="/struts-tags"%>
${aier_doctype}
<html <s:property value="aier_html_xmlns" escape="false"/>>
<head>
<meta http-equiv="Content-Type" content="${aier_content_type}" />
<meta name="keywords" content="${aier_keyworks}" />
<meta name="description" content="${aier_description}" />
<link rel="stylesheet" href="${aier_css_url}${aier_jqui_css}ui.css" />
<link rel="stylesheet" href="${aier_css_url}${aier_jqui_css}text.css" />
<link rel="stylesheet"
	href="${aier_css_url}${aier_jqui_css}enhanced.css" />
	<link rel="stylesheet" href="${aier_css_url}social/module/jq-msg.css" />
<link rel="stylesheet" href="${aier_css_url}proxy/cf.css" />

<script type="text/javascript" src="${aier_js_url}j.js"></script>
<script type="text/javascript" src="${aier_js_url}b.js"></script>
<script type="text/javascript" src="${aier_js_url}jp/hh/ui.js"></script>
<script type="text/javascript" src="${aier_js_url}jp/msg.js"></script>
<script type="text/javascript"
	src="${aier_js_url}${aier_jqui_js}custominput.js"></script>
<script type="text/javascript"
	src="${aier_js_url}${aier_jqui_js}text.js"></script>
</head>
<body>

	<div id="tabs">
		<ul>
			<li><a href="#tabs-1">创建学校</a></li>
		</ul>
		<div id="tabs-1" style="height: 500px;">
			<div class="d_content">
				<div data-label="学校名称" class="d_scnOut">
					<div class="d_scname">
						<label for="txt_sName">学校名称:</label>
					</div>
					<div class="d_sctext">
						<input type="text" id="txt_sName" class="txt_scname">
					</div>
				</div>
				<div data-label="管理员账号" class="d_scnOut">
					<div class="d_scname">
						<label for="txt_saAccount">超级管理员账号:</label>
					</div>
					<div class="d_sctext">
						<input type="text" id="txt_saAccount" class="txt_scname">
					</div>
					<div data-label="创建账号"
						style="margin-top:-20px;margin-left: 300px;width: 300px;">
						<span id="cs_acinfor"></span>
					</div>
				</div>
				<div data-label="学校地址" class="d_scnOut"
					style="height: 70px;margin-top: 20px;">
					<div class="d_scname">
						<label for="txt_region">学校地址:</label>
					</div>
					<div class="sel_region">
						<s:action name="cityutil" namespace="/common" executeResult="true">
							<s:param name="dvid">cs_region</s:param>
							<s:param name="cityid" value="%{pcid}" />
							<s:param name="jaddress">true</s:param>
						</s:action>
					</div>
				</div>
				<div data-label="学校简介" class="d_scnOut" style = "width:500px;height: 220px;">
				    <div class="d_scname">
                        <label for="txt_desinfo">学校简介:</label>
                    </div>
                    <div class="d_url">
                        <textarea id="txt_desinfo" style = "width:500px;height: 200px;"></textarea>
                    </div>
				</div>
				<button id="but_create" style="margin-left: 300px;margin-top: 0px;"
					class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only"
					role="button" aria-disabled="false">
					<span class="ui-button-text">创建</span>
				</button>
			</div>
		</div>

	</div>


</body>
<script type="text/javascript">
	$("#tabs").tabs();

	$("#but_create").click(function() {
		if (isnull($("#txt_sName").val())) {
			$().message("请输入学校名称！");
			return
		} 
		if (isnull($("#txt_saAccount").val())) {
			$().message("请输入管理员账号！");
			return
		}
		if($("#txt_desinfo").val().length > 500) {
		 $().message("学校简介太长，请重新输入！");
		 return
		} 
	
		var fun = function(data) {
			if (1 == data.s) {
				$().message("创建成功!");
				location.href = "${aier_url}proxy/searchschool${aier_suffix}?pid="
						+ data.pid + "";
			}else {
				$().message("创建失败!"+data.error_info);
			}
		};
		exeAjax(
				ajaxUrl("${aier_url}${aier_urijs}createschool_psc_create${aier_suffix}?pid=${pid}"),
				fun, {
					"scName" : $("#txt_sName").val(),
					"scAccount" : $("#txt_saAccount").val(),
					"city" : acity.cname,
					"city_id" : acity.cid,
                       "desinfo" : $("#txt_desinfo").val()
				});
});

</script>
</html>